{include file='index/header'/}

<div style="padding:20px; ">
    <div style="background: #FFFFFF;padding: 20px 50px;">
        <div style="margin: 10px 0px;">
        <span class="layui-breadcrumb">
  <a href="">首页</a>
  <a href="">器具租借</a>
  <a><cite>小型器具借用申请</cite></a>
</span>
        </div>
            <div class="layui-row">
            </div>
                <form class="layui-form " method="get" action="">
                    <div class="layui-form-item">
                        <div class="layui-input-inline">
                            <input type="text" id="test2" name="date"  placeholder="器具名称"  class="layui-input" >
                        </div>
                        <button class="layui-btn" type="submit"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
                    </div>

                </form>
            <table class="layui-table">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>器具名称</th>
                    <th>所属课室</th>
                    <th>可借最大天数</th>
                    <th>管理教师</th>
                    <th>操作</th>
                </thead>
                <tbody>
                {volist name="tools" id="tool"}
                <tr>
                    <td>{$tool.id}</td>
                    <td>{$tool.name}</td>
                    <td>{$tool->lab->name}</td>
                    <td>{$tool.num}天</td>
                    <td>
                        {$tool->lab->teacher->realname}
                    </td>
                    <td>
                        <a title="申请预约" onclick="tool_app(this,'{$tool.id}')" href="javascript:;">
                            <!--<i class="layui-icon">&#xe640;</i>-->
                            申请借
                        </a>
                    </td>
                </tr>
                {/volist}
                </tbody>
            </table>
       
        <div class="page">
           
        </div>
       
    </div>
{include file='index/footer'/}
<script>
    $('#tool_app').addClass("layui-nav-itemed");
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#test2' //指定元素
        });
    });
    layui.use('form', function(){
        var form = layui.form;
        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
    function tool_app(obj,id) {
        layer.open({
            title:'借出申请',
            type: 2,
            area: ['600px', '410px'],
            shadeClose: true, //点击遮罩关闭
            content: "{:url('tool_app/tool_choose')}/id/"+id,
        })
    }
</script>

